package start.eventbus;

import com.google.common.eventbus.Subscribe;
import start.entity.Book;

public class EventListener01 {


    /**

     * 监听 Integer 类型的消息

     */

    @Subscribe
    public void listenInteger(Integer param) {
        //System.out.println(Thread.currentThread().getName());
        System.out.println(this.getClass().getSimpleName() + "#listenInteger ->" + param);
    }

    /**

     * 监听 String 类型的消息

     */

    @Subscribe
    public void listenString(String param) {
        System.out.println(this.getClass().getSimpleName() + "#listenString ->" + param);
    }

    @Subscribe
    public void listenBook(Book book) {
        System.out.println(book);
    }

}